package com.xinqi.modules.course.clazz.controller.inner;

import com.xinqi.common.base.response.R;
import com.xinqi.modules.course.clazz.client.ClassGroupStudentClient;
import com.xinqi.modules.course.clazz.dto.rsp.ClassGroupStudentResultDTO;
import com.xinqi.modules.course.clazz.service.ClassGroupStudentService;
import io.swagger.v3.oas.annotations.Hidden;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Primary;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * 班级分组人员表内部控制层
 *
 * @author: system
 * @date: 2023/10/31
 */
@Hidden
@Primary
@RestController
@RequiredArgsConstructor
public class ClassGroupStudentInnerController implements ClassGroupStudentClient {
    private final ClassGroupStudentService classGroupStudentService;

    @Override
    public R<ClassGroupStudentResultDTO> findById(Long id) {
        ClassGroupStudentResultDTO dto = classGroupStudentService.findById(id);
        return R.data(dto);
    }

    @Override
    public R<List<ClassGroupStudentResultDTO>> findStudentListByGroupIds(List<Long> groupList) {
        return R.data(classGroupStudentService.findStudentListByGroupIds(groupList));
    }
}
